#ifndef _PANDAX_TEXTUREATLAS_H__
#define _PANDAX_TEXTUREATLAS_H__
#include "../utility/px_type.h"
#include "px_texture2d.h"
typedef struct _textureatlas
{
	PXV3F_C4B_T2F_Quad* pquads;
	short * pIndices;
	PXINT32 total_quads;
	PXINT32 capacity;
	PXTEXTURE2D * ptexture;
}PXTEXTUREATLAS;


typedef struct _rotateParam
{
	PXPOINT center_point;
	float angle;
}RotateParam;


PXBOOL init_withtexture(PXTEXTUREATLAS* atlas,PXTEXTURE2D * texture,PXUINT32 capacity);
PXBOOL init_withfile(PXTEXTUREATLAS* atlas,const char * fileName,PXUINT32 capacity);
PXBOOL init_withfile_png(PXTEXTUREATLAS* atlas,const char * fileName,PXUINT32 capacity);
void update_quad(PXTEXTUREATLAS* atlas,PXV3F_C4B_T2F_Quad *quad, unsigned int index);
void draw_quads(PXTEXTUREATLAS * atlas);
void remove_allQuads(PXTEXTUREATLAS * atlas);
void setQuad( PXTEXTUREATLAS * atlas,float x,float y,float w, float h,float * texCoor,unsigned int n,RotateParam * rp);
#endif // px_textureatlas_h__
